<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<script type="text/javascript">

		function baseClass()
		{
		    this.showMsg = function()
		    {
		        alert("baseClass::showMsg");   
		    }
		   
		    this.baseShowMsg = function()
		    {
		        alert("baseClass::baseShowMsg");
		    }
		}
		baseClass.showMsg = function()
		{
		    alert("baseClass::showMsg static");
		}
		
		function extendClass()
		{
		    this.showMsg =function ()
		    {
		        alert("extendClass::showMsg");
		    }
		}
		extendClass.showMsg = function()
		{
		    alert("extendClass::showMsg static")
		}
		
		extendClass.prototype = new baseClass();
		var instance = new extendClass();
		
		instance.showMsg(); //显示extendClass::showMsg
		instance.baseShowMsg(); //显示baseClass::baseShowMsg
		instance.showMsg(); //显示extendClass::showMsg
		
		baseClass.showMsg.call(instance);//显示baseClass::showMsg static
		
		var baseinstance = new baseClass();
		baseinstance.showMsg.call(instance);//显示baseClass::showMsg

</script>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>

</body>
</html>